package br.com.lh.urabuilder.util
{
	import flash.display.Graphics;
	
	import mx.core.UIComponent;
	
	public class BorderDrawer
	{
		public static function drawBorder(component:UIComponent,selected:Boolean):void{

			var graphics:Graphics = component.graphics;
			graphics.clear();
			if (selected){
				doDraw(component);
			}
		}
		
		private static function doDraw(component:UIComponent):void{
		    var graphics:Graphics = component.graphics;
		    var width:Number = component.width;
	        var height:Number = component.height;
	        // colors set using MSPaint ..  :) (to be changed)
			var red:uint;
		 	var green:uint;
			var blue:uint;
	    	red = 0;
	 		green = 132;
			blue = 132;
			var borderColor:uint = red << 16 | green << 8 | blue;
			graphics.lineStyle(4,borderColor);
	      	graphics.moveTo(0,0);
	      	graphics.lineTo(0,height);
	      	graphics.lineTo(width,height);  
	      	graphics.lineTo(width,0);
	      	graphics.lineTo(0,0);
		}

	}
}